export default (url) => {
  const crud = window.$crud(url);

  const getCodeTemp = (data) =>
    window.$axios({
      url: `${url}/codetemp/${data}`,
      method: "get",
    });

  const generatorApiCode = (data) =>
    window.$axios({
      url: `${url}/scode`,
      method: "post",
      data,
    });

  const generatorWCode = (data) =>
    window.$axios({
      url: `${url}/wcode`,
      method: "post",
      data,
      responseType: "arraybuffer",
    });

  const getAppPageJson = (params) =>
    window.$axios({
      url: `${url}/apppagejs`,
      method: "get",
      params,
    });

  return {
    ...crud,
    getCodeTemp,
    generatorApiCode,
    generatorWCode,
    getAppPageJson,
  };
};
